# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Vincent B. <vb@luminar.eu.org>

pkgname=opam
pkgver=2.1.4
pkgrel=1
pkgdesc='OCaml package manager'
arch=(loong64 x86_64)
url='https://opam.ocaml.org/'
license=(GPL)
depends=(bubblewrap ocaml-compiler-libs unzip)
makedepends=(git)
optdepends=('darcs: For downloading packages with darcs'
            'git: For downloading packages with git'
            'mercurial: For downloading packages with mercurial'
            'rsync: For downloading packages with rsync')
source=("https://github.com/ocaml/opam/releases/download/$pkgver/opam-full-$pkgver.tar.gz")
b2sums=('a95953a62ce2bb0c0d36512b7e393e10150b9bcc23d0847639511153a818db79d63969e6482d18e9316c18b0eac797727236382c5c5acaeacfe5a97b6de2548c')

build() {
  cd opam-full-$pkgver
  ./configure --prefix=/usr
  make lib-ext all -j1 \
    OCAMLC='ocamlc -unsafe-string' \
    OCAMLOPT='ocamlopt -unsafe-string'
}

package() {
  make -C opam-full-$pkgver DESTDIR="$pkgdir" install
}
